#pragma once

#include <Windows.h>
#include "Command.h"
#include "Defines.h"

#define PluginInterfaceVersion 0x01000000;

class PluginManager;
class ObjectManager;

class ModuleInfo
{
public:
	ModuleInfo();
	Value pluginName;
	Value author;
	int version;
	Value *commands;
	__declspec( property ( get=GetNumOfCommands, put = SetNumOfCommands) ) int numOfCommands;
	int GetNumOfCommands();
	void SetNumOfCommands(int NewNumber);
protected:	
	int Count;
};

class IPlugin
{
public:
	virtual void __stdcall Initialize(PluginManager *Parent, ObjectManager *Objects) = 0;
	virtual void __stdcall Dispose() = 0;
	virtual void __stdcall DeleteThis() = 0;
	virtual ModuleInfo __stdcall GetModuleInfo() = 0;
	virtual bool __stdcall HandleCommand(Command &NewCommand) = 0;
};

class PluginBase : public IPlugin
{
public:
	PluginBase();
	void __stdcall Initialize(PluginManager* Parent, ObjectManager *Objects);
	void __stdcall Dispose();
	void __stdcall DeleteThis();
	ModuleInfo __stdcall GetModuleInfo();
	bool __stdcall HandleCommand(Command &NewCommand);
protected:
	PluginManager *m_Manager;
	ObjectManager *m_Objects;
	ModuleInfo m_ModuleInfo;
};